Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix navigation with proper fraction #1128

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

MrRogerHuang
Copy link

These two lines could have numbers between 0 and 1 (proper fractions) during navigations:

this.scrollLeft = this.container.scrollLeft;

this.scrollTop = this.container.scrollTop;

Even if an ePub section (e.g. a cover page or a table of content page) has only one page, a proper fraction causes prev() or next() can't correct go to the previous or next section, because these condition tests are true:

this.scrollLeft = this.container.scrollLeft;

this.scrollTop = this.container.scrollTop;

A browser inspector confirms the problem (this.container.scrollLeft has a value 0.8000...):

In user perspective, user has to execute prev() or next() twice to correctly go to the previous or next section!

This pull request fixes only two navigation cases (depending on section layouts), not all navigation cases, because my tested ePub files can only triggers these two cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants